diff options
author | Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org> | 2010-01-16 20:18:17 -0300 |
---|---|---|
committer | Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org> | 2010-01-16 20:18:17 -0300 |
commit | de651f6692e17eb73f56dff05a724e7e05269761 (patch) | |
tree | b60fa307f401a8b46e51d2e08d497d3663272e8b | |
parent | f5b001f9ca0e3051bd04a8b922c8f2815f140a65 (diff) |
listScreen: Fixed 2 bugs of total values not being updated
Fixes the bug of the subtotal label not being updated when a new value
is inserted and also fixes the overall list, where the categories totals weren't
updated too.
Signed-off-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>
-rw-r--r-- | mybudget/src/lists/listscreen.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mybudget/src/lists/listscreen.cpp b/mybudget/src/lists/listscreen.cpp index 4cc0eaf..dc68504 100644 --- a/mybudget/src/lists/listscreen.cpp +++ b/mybudget/src/lists/listscreen.cpp @@ -183,6 +183,16 @@ void ListScreen::loadCategory(const QString &category) void ListScreen::categoryUpdated(const QString &category) { updateModel(category); + + // To update the label when a new value is inserted + setTotalLabelValue(m_totals.value(category, 0)); + + /* + When a category is updated, we need to update the overall list too. + As the category argument here cames from the edited one, it will never + be "overall" because there is no edit mode for it. + */ + updateModel("overall"); } void ListScreen::updateModel(const QString &category) |